﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Sprites.DataUtility
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

#nullable disable
namespace UnityEngine.Sprites
{
  /// <summary>
  ///   <para>Helper utilities for accessing Sprite data.</para>
  /// </summary>
  public sealed class DataUtility
  {
    /// <summary>
    ///   <para>Inner UV's of the Sprite.</para>
    /// </summary>
    /// <param name="sprite"></param>
    public static Vector4 GetInnerUV(Sprite sprite) => sprite.GetInnerUVs();

    /// <summary>
    ///   <para>Outer UV's of the Sprite.</para>
    /// </summary>
    /// <param name="sprite"></param>
    public static Vector4 GetOuterUV(Sprite sprite) => sprite.GetOuterUVs();

    /// <summary>
    ///   <para>Return the padding on the sprite.</para>
    /// </summary>
    /// <param name="sprite"></param>
    public static Vector4 GetPadding(Sprite sprite) => sprite.GetPadding();

    /// <summary>
    ///   <para>Minimum width and height of the Sprite.</para>
    /// </summary>
    /// <param name="sprite"></param>
    public static Vector2 GetMinSize(Sprite sprite)
    {
      Vector2 minSize;
      minSize.x = sprite.border.x + sprite.border.z;
      minSize.y = sprite.border.y + sprite.border.w;
      return minSize;
    }
  }
}
